.class public Lcom/netease/newsreader/service/MsgPushService;
.super Landroid/app/Service;
.source "MsgPushService.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/netease/newsreader/service/MsgPushService$DownloadDataThreadHandler;
    }
.end annotation


# instance fields
.field private appdata:Lcom/netease/newsreader/activity/MyApplication;

.field private count:I

.field private detailpage:Landroid/content/Intent;

.field private end:J

.field private flag:Z

.field private mNotificationManager:Landroid/app/NotificationManager;

.field private mythread:Ljava/lang/Thread;

.field private newestdocid:Ljava/lang/String;

.field private pushurl:Ljava/lang/String;

.field private set_prefs:Landroid/content/SharedPreferences;

.field private start:J

.field private timeout:I


# direct methods
.method public constructor <init>()V
    .locals 4

    .prologue
    const-wide/16 v2, 0x0

    const/4 v1, 0x0

    .line 27
    invoke-direct {p0}, Landroid/app/Service;-><init>()V

    .line 29
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->newestdocid:Ljava/lang/String;

    .line 30
    const v0, 0xa1220

    iput v0, p0, Lcom/netease/newsreader/service/MsgPushService;->timeout:I

    .line 31
    iput-object v1, p0, Lcom/netease/newsreader/service/MsgPushService;->mNotificationManager:Landroid/app/NotificationManager;

    .line 32
    iput-object v1, p0, Lcom/netease/newsreader/service/MsgPushService;->detailpage:Landroid/content/Intent;

    .line 34
    const/4 v0, 0x1

    iput-boolean v0, p0, Lcom/netease/newsreader/service/MsgPushService;->flag:Z

    .line 37
    const-string v0, ""

    iput-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->pushurl:Ljava/lang/String;

    .line 38
    const/4 v0, 0x0

    iput v0, p0, Lcom/netease/newsreader/service/MsgPushService;->count:I

    .line 39
    iput-wide v2, p0, Lcom/netease/newsreader/service/MsgPushService;->start:J

    .line 40
    iput-wide v2, p0, Lcom/netease/newsreader/service/MsgPushService;->end:J

    .line 27
    return-void
.end method

.method static synthetic access$0(Lcom/netease/newsreader/service/MsgPushService;)Z
    .locals 1
    .parameter

    .prologue
    .line 34
    iget-boolean v0, p0, Lcom/netease/newsreader/service/MsgPushService;->flag:Z

    return v0
.end method

.method static synthetic access$1(Lcom/netease/newsreader/service/MsgPushService;)Landroid/content/SharedPreferences;
    .locals 1
    .parameter

    .prologue
    .line 35
    iget-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->set_prefs:Landroid/content/SharedPreferences;

    return-object v0
.end method

.method static synthetic access$10(Lcom/netease/newsreader/service/MsgPushService;)J
    .locals 2
    .parameter

    .prologue
    .line 39
    iget-wide v0, p0, Lcom/netease/newsreader/service/MsgPushService;->start:J

    return-wide v0
.end method

.method static synthetic access$2(Lcom/netease/newsreader/service/MsgPushService;Ljava/lang/String;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 29
    iput-object p1, p0, Lcom/netease/newsreader/service/MsgPushService;->newestdocid:Ljava/lang/String;

    return-void
.end method

.method static synthetic access$3(Lcom/netease/newsreader/service/MsgPushService;J)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 39
    iput-wide p1, p0, Lcom/netease/newsreader/service/MsgPushService;->start:J

    return-void
.end method

.method static synthetic access$4(Lcom/netease/newsreader/service/MsgPushService;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 29
    iget-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->newestdocid:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$5(Lcom/netease/newsreader/service/MsgPushService;)I
    .locals 1
    .parameter

    .prologue
    .line 30
    iget v0, p0, Lcom/netease/newsreader/service/MsgPushService;->timeout:I

    return v0
.end method

.method static synthetic access$6(Lcom/netease/newsreader/service/MsgPushService;J)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 40
    iput-wide p1, p0, Lcom/netease/newsreader/service/MsgPushService;->end:J

    return-void
.end method

.method static synthetic access$7(Lcom/netease/newsreader/service/MsgPushService;)Landroid/content/Intent;
    .locals 1
    .parameter

    .prologue
    .line 32
    iget-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->detailpage:Landroid/content/Intent;

    return-object v0
.end method

.method static synthetic access$8(Lcom/netease/newsreader/service/MsgPushService;Landroid/content/Intent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;II)V
    .locals 0
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter
    .parameter

    .prologue
    .line 74
    invoke-direct/range {p0 .. p7}, Lcom/netease/newsreader/service/MsgPushService;->showNotification(Landroid/content/Intent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;II)V

    return-void
.end method

.method static synthetic access$9(Lcom/netease/newsreader/service/MsgPushService;)J
    .locals 2
    .parameter

    .prologue
    .line 40
    iget-wide v0, p0, Lcom/netease/newsreader/service/MsgPushService;->end:J

    return-wide v0
.end method

.method private showNotification(Landroid/content/Intent;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;II)V
    .locals 6
    .parameter "destintent"
    .parameter "articleid"
    .parameter "tickerText"
    .parameter "contentTitle"
    .parameter "contentText"
    .parameter "id"
    .parameter "resId"

    .prologue
    const/high16 v5, 0x1000

    const/4 v4, 0x1

    .line 78
    new-instance v1, Landroid/app/Notification;

    .line 79
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    .line 78
    invoke-direct {v1, p7, p3, v2, v3}, Landroid/app/Notification;-><init>(ILjava/lang/CharSequence;J)V

    .line 81
    .local v1, notification:Landroid/app/Notification;
    iget-object v2, p0, Lcom/netease/newsreader/service/MsgPushService;->mNotificationManager:Landroid/app/NotificationManager;

    invoke-virtual {v2, p6}, Landroid/app/NotificationManager;->cancel(I)V

    .line 82
    iput v4, v1, Landroid/app/Notification;->defaults:I

    .line 83
    invoke-virtual {p1, v5}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;

    .line 84
    const-string v2, "docid"

    invoke-virtual {p1, v2, p2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 85
    const-string v2, "position"

    const-string v3, "0"

    invoke-virtual {p1, v2, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 86
    const-string v2, "headLine"

    invoke-virtual {p1, v2, v4}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Z)Landroid/content/Intent;

    .line 87
    invoke-static {p0, p7, p1, v5}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;

    move-result-object v0

    .line 96
    .local v0, contentIntent:Landroid/app/PendingIntent;
    invoke-virtual {v1, p0, p4, p5, v0}, Landroid/app/Notification;->setLatestEventInfo(Landroid/content/Context;Ljava/lang/CharSequence;Ljava/lang/CharSequence;Landroid/app/PendingIntent;)V

    .line 97
    iget-object v2, p0, Lcom/netease/newsreader/service/MsgPushService;->mNotificationManager:Landroid/app/NotificationManager;

    invoke-virtual {v2, p6, v1}, Landroid/app/NotificationManager;->notify(ILandroid/app/Notification;)V

    .line 98
    return-void
.end method


# virtual methods
.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
    .locals 1
    .parameter "arg0"

    .prologue
    .line 61
    const/4 v0, 0x0

    return-object v0
.end method

.method public onCreate()V
    .locals 3

    .prologue
    .line 44
    invoke-super {p0}, Landroid/app/Service;->onCreate()V

    .line 46
    const-string v0, "notification"

    invoke-virtual {p0, v0}, Lcom/netease/newsreader/service/MsgPushService;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/NotificationManager;

    iput-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->mNotificationManager:Landroid/app/NotificationManager;

    .line 47
    invoke-static {p0}, Landroid/preference/PreferenceManager;->getDefaultSharedPreferences(Landroid/content/Context;)Landroid/content/SharedPreferences;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->set_prefs:Landroid/content/SharedPreferences;

    .line 49
    invoke-virtual {p0}, Lcom/netease/newsreader/service/MsgPushService;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    check-cast v0, Lcom/netease/newsreader/activity/MyApplication;

    iput-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->appdata:Lcom/netease/newsreader/activity/MyApplication;

    .line 50
    iget-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->set_prefs:Landroid/content/SharedPreferences;

    const-string v1, "newestdocid"

    const-string v2, ""

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->newestdocid:Ljava/lang/String;

    .line 51
    new-instance v0, Landroid/content/Intent;

    const-class v1, Lcom/netease/newsreader/activity/DetailPushPage;

    invoke-direct {v0, p0, v1}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V

    iput-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->detailpage:Landroid/content/Intent;

    .line 52
    iget-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->detailpage:Landroid/content/Intent;

    const-string v1, "push"

    const-string v2, "push"

    invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 53
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/netease/newsreader/service/MsgPushService$DownloadDataThreadHandler;

    invoke-direct {v1, p0}, Lcom/netease/newsreader/service/MsgPushService$DownloadDataThreadHandler;-><init>(Lcom/netease/newsreader/service/MsgPushService;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    iput-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->mythread:Ljava/lang/Thread;

    .line 54
    iget-object v0, p0, Lcom/netease/newsreader/service/MsgPushService;->mythread:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    .line 56
    return-void
.end method

.method public onDestroy()V
    .locals 1

    .prologue
    .line 67
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/netease/newsreader/service/MsgPushService;->flag:Z

    .line 68
    invoke-super {p0}, Landroid/app/Service;->onDestroy()V

    .line 70
    return-void
.end method
